home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / music / cthugha5.zip / CTHU5SRC.ZIP / FORTE.H < prev    next >
C/C++ Source or Header  |  1994-08-19  |  4KB  |  155 lines

  1. /***************************************************************************
  2. *    NAME:  FORTE.H
  3. **    COPYRIGHT:
  4. **    "Copyright (c) 1992, by FORTE
  5. **
  6. **       "This software is furnished under a license and may be used,
  7. **       copied, or disclosed only in accordance with the terms of such
  8. **       license and with the inclusion of the above copyright notice.
  9. **       This software or any other copies thereof may not be provided or
  10. **       otherwise made available to any other person. No title to and
  11. **       ownership of the software is hereby transfered."
  12. ****************************************************************************
  13. *  CREATION DATE: 07/30/92
  14. *--------------------------------------------------------------------------*
  15. *     VERSION    DATE       NAME        DESCRIPTION
  16. *>    1.0    07/30/92        Original
  17. ***************************************************************************/
  18.  
  19. /* Either define 1 of these here or on the compiler command line */
  20. //#define BORLANDC
  21. //#define MSOFTC
  22. //#define WATCOMC
  23. //#define METAWARE
  24.  
  25. #ifdef __HIGHC__
  26. #define METAWARE
  27. #endif
  28.  
  29. #ifdef __BORLANDC__
  30. #define BORLANDC
  31. #endif
  32.  
  33. #ifdef _MSC_VER
  34. #define MSOFTC
  35. #endif
  36.  
  37. #ifdef __WATCOMC__
  38. #define WATCOMC
  39. #endif
  40.  
  41. /***************************************************************************
  42.  *
  43.  *    BORLANDC Compilers
  44.  *
  45.  **************************************************************************/
  46. #ifdef BORLANDC
  47. #define ENTER_CRITICAL    asm pushf; asm cli;
  48. #define ENTER_CRITICAL_ON    asm pushf; asm sti;
  49. #define LEAVE_CRITICAL        asm popf;
  50. #define LEAVE_CRITICAL_ON LEAVE_CRITICAL
  51. #define FARFUNC            far
  52. #undef FLAT_MODEL
  53. #endif
  54.  
  55. /***************************************************************************
  56.  *
  57.  *    MICROSOFT Compilers
  58.  *
  59.  **************************************************************************/
  60. #ifdef MSOFTC
  61. #define asm    _asm
  62. #define interrupt _interrupt
  63. #define ENTER_CRITICAL    _asm pushf; _asm cli;
  64. #define ENTER_CRITICAL_ON    _asm pushf; _asm sti;
  65. #define LEAVE_CRITICAL        _asm popf;
  66. #define LEAVE_CRITICAL_ON LEAVE_CRITICAL
  67. #define FARFUNC            far
  68. #undef FLAT_MODEL
  69. #endif
  70.  
  71. /***************************************************************************
  72.  *
  73.  *    WATCOM Compiler
  74.  *
  75.  **************************************************************************/
  76. #ifdef WATCOMC
  77. #undef far
  78. #define far
  79. #define FARFUNC            __far
  80. #define FLAT_MODEL
  81.  
  82. #define ENTER_CRITICAL IRQ_PUSH_OFF()
  83. extern void IRQ_PUSH_OFF (void);
  84. #pragma aux IRQ_PUSH_OFF =    \
  85.     "pushfd",            \
  86.     "cli";
  87.  
  88. #define ENTER_CRITICAL_ON IRQ_PUSH_ON()
  89. extern void IRQ_PUSH_ON (void);
  90. #pragma aux IRQ_PUSH_ON =    \
  91.     "pushfd",            \
  92.     "sti";
  93.  
  94. #define LEAVE_CRITICAL IRQ_POP()
  95. extern void IRQ_POP (void);
  96. #pragma aux IRQ_POP =    \
  97.     "popfd";
  98. #define LEAVE_CRITICAL_ON LEAVE_CRITICAL
  99. #endif
  100.  
  101. /***************************************************************************
  102.  *
  103.  *    METAWARE HIGHC Compiler
  104.  *
  105.  **************************************************************************/
  106. #ifdef METAWARE
  107.  
  108. #define inp _inb
  109. #define inpw _inpw
  110. #define outp _outb
  111. #define outpw _outw
  112.  
  113. #pragma On (Globals_volatile)
  114.  
  115. #undef far
  116. #define far    _Far
  117. #define FARFUNC
  118. #define FLAT_MODEL
  119. #ifdef NEVER
  120. #define OPCODE_NOP        0x90
  121. #define OPCODE_PUSHF    0x9c
  122. #define OPCODE_CLI        0xfa
  123. #define OPCODE_STI        0xfb
  124. #define OPCODE_POPF        0x9d
  125. #define ENTER_CRITICAL    _inline(OPCODE_PUSHF);\
  126.   _inline(OPCODE_CLI);
  127. #define ENTER_CRITICAL_ON    _inline(OPCODE_PUSHF);\
  128.   _inline(OPCODE_STI);
  129. #define LEAVE_CRITICAL        _inline(OPCODE_POPF);
  130. #endif
  131.  
  132. #define ENTER_CRITICAL    _gf1_data.gf1_sema4++;
  133. extern void leave_critical();
  134. #define LEAVE_CRITICAL    leave_critical();
  135. #define ENTER_CRITICAL_ON
  136. #define LEAVE_CRITICAL_ON
  137. #endif
  138.  
  139. /*****************************************************************/
  140.  
  141. #define        TRUE    1
  142. #define        FALSE    0
  143.  
  144. #define ON            1
  145. #define OFF            0
  146.  
  147. typedef     void     (*PFV)();
  148. typedef     int     (*PFI)();
  149. #ifdef METAWARE
  150. typedef     _Far _INTERRPT void (*PVI)();
  151. #else
  152. typedef     void     (interrupt FARFUNC *PVI)();
  153. #endif
  154.  
  155.